package com.qf.myboot.controller;

import com.qf.myboot.result.ResponseData;
import com.qf.myboot.service.PicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * (Pic)表控制层
 *
 * @author makejava
 * @since 2021-05-24 11:16:37
 */
@Api(value = "picApi")
@RestController
@RequestMapping("pic")
public class PicController {
    /**
     * 服务对象
     */
    @Autowired
    private PicService picService;

    @ApiOperation(value = "queryByType",notes = "通过图片类型获取对应的图片列表")
    @ApiImplicitParam(name = "type",value = "图片类型")
    @GetMapping("queryByType/{type}")
    public ResponseData queryByType(@PathVariable String type){
        //控制层  1. 接收请求  2.处理参数   3. 调用服务  4. 返回结果集或者返回路径
         return picService.queryByType(type);
    }

}
